<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>slot</title>
  </head>
  <body>
    <div id="app">
      <component-with-named-slot>
        <template v-slot:header>
          <h1>header</h1>
        </template>
        <h1>main</h1>
        <template v-slot:footer>
          <h1>footer</h1>
        </template>
      </component-with-named-slot>
    </div>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
    <script>
      var vm = new Vue({
        el: "#app",
        components: {
          "component-with-named-slot": {
            template: `
            <div>
              <header><slot name="header"></slot></header>
              <main><slot></slot></main>
              <footer><slot  name="footer"></slot></footer>
            </div>`,
          },
        },
      });
    </script>
  </body>
</html>
